﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.Tools.Services.Captcha/ISlideCaptchaService 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       ISlideCaptchaService
* 创建时间：  2025/6/4 11:22:57
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion
using Lazy.SlideCaptcha.Core;
using Lazy.SlideCaptcha.Core.Validator;
using SSPivot.Admin.Core.Service.communal.Captcha.Dto;
using SSPivot.AspNetCore.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.Tools.Services.Captcha
{
    /// <summary>
    /// 滑动验证
    /// </summary>
    public interface ISlideCaptchaService : IApplicationService
    {
        /// <summary>
        /// 校验
        /// </summary>
        /// <param name="captchaId">验证码id</param>
        /// <param name="slideTrack">滑动轨迹</param>
        /// <param name="removeIfSuccess">校验成功时是否移除缓存(用于多次验证)</param>
        /// <returns></returns>
        ValidateResult Validate(string captchaId, SlideTrack slideTrack, bool removeIfSuccess = true);
        /// <summary>
        /// 获得验证数据
        /// </summary>
        /// <returns></returns>
        Task<CaptchaOutput> GetAsync(string captchaKey);

        /// <summary>
        /// 检查验证数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> CheckAsync(CaptchaInput input);
    }
}

